module.exports = function ($scope,$resource, $state,$modalInstance, $modal, toaster,tcode) {
      var tourgroup_code = tcode;
      console.log("sa");
      console.log(tourgroup_code);
      $scope.objs = []
      var para = {
        'tcode' : tourgroup_code,
        'list' : $scope.objs
      }

      $scope.save = function () {
        // alert("看好了~我要保存了！");
        $resource('/api/ac/ggc/tourGroupAfter/createTGroupPeo', {}, {}).save(para,function (res) {
          if(res.errcode !== 0){
            toaster.error({ title: "提示", body: res.errmsg });
          }else{
            toaster.success({title: "提示", body: "创建成功！"});
            $modalInstance.close();
          }
        });
      }
      $scope.addp = function() {
        
        $scope.objs.push({
          name : '',
          tel : '',
          people_idcard : '',
          people_adress : '',
        })
        $scope.remove = function (index) {
          $scope.objs.splice(index, 1);
      }
    }
}